unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, Menus,
  JvFormPlacement, JvAppIniStorage, ExtCtrls, JvAppStorage, JvComponentBase,
  ToolWin;

type
  TForm1 = class(TForm)
    StatusBar1: TStatusBar;
    MainMenu1: TMainMenu;
    Atualizacoes1: TMenuItem;
    DBIN1: TMenuItem;
    Historicas1: TMenuItem;
    Janelas1: TMenuItem;
    LadoaLado1: TMenuItem;
    Cascata1: TMenuItem;
    LadoaLadoVertical1: TMenuItem;
    Exibir1: TMenuItem;
    CotacoesBovespa1: TMenuItem;
    JvFormStorage1: TJvFormStorage;
    JvAppIniFileStorage1: TJvAppIniFileStorage;
    N1: TMenuItem;
    ListaForms: TMenuItem;
    Panel1: TPanel;
    procedure DBIN1Click(Sender: TObject);
    procedure Historicas1Click(Sender: TObject);
    procedure Cascata1Click(Sender: TObject);
    procedure LadoaLado1Click(Sender: TObject);
    procedure LadoaLadoVertical1Click(Sender: TObject);
    procedure CotacoesBovespa1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private

  public

  end;

var
  Form1: TForm1;

implementation

uses UntUpdateBDIN, UntUpdateCotacoesHistoricas, UntFrmGrafico, UnFrmCotacoes;

{$R *.dfm}


procedure TForm1.Cascata1Click(Sender: TObject);
begin
  Cascade;
end;

procedure TForm1.CotacoesBovespa1Click(Sender: TObject);
var FrmCotacoes: TFrmCotacoes;
begin
  CotacoesBovespa1.Checked := not CotacoesBovespa1.Checked;

  if CotacoesBovespa1.Checked then begin
    FrmCotacoes := TFrmCotacoes.Create(Self);
    FrmCotacoes.DragKind := dkDock;
    FrmCotacoes.DragMode := dmManual;
    FrmCotacoes.UseDockManager := True;
    FrmCotacoes.ManualDock(Panel1);
    FrmCotacoes.show;
    Panel1.Visible := True;
  end else begin
    Panel1.Visible := False;
    //
  end;
end;

procedure TForm1.DBIN1Click(Sender: TObject);
begin
  Application.CreateForm(TFrmUpdateBDIN,FrmUpdateBDIN);
  FrmUpdateBDIN.Show;
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  JvFormStorage1.SaveFormPlacement;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  JvFormStorage1.RestoreFormPlacement;
end;

procedure TForm1.Historicas1Click(Sender: TObject);
begin
  Application.CreateForm(TFrmImportCotHist,FrmImportCotHist);
  FrmImportCotHist.Show;
end;

procedure TForm1.LadoaLado1Click(Sender: TObject);
begin
  TileMode := tbHorizontal;
  Tile;
end;

procedure TForm1.LadoaLadoVertical1Click(Sender: TObject);
begin
  TileMode := tbVertical;
  Tile;
end;


end.
